package c15IO;

import java.io.File;

public class MkDirs {

	public void dirs5e5(String rootDir) {
		int count = 5;
		for (int i = 0; i < count; i++) {
			for (int j = 0; j < count; j++) {
				for (int k = 0; k < count; k++) {
					for (int l = 0; l < count; l++) {
						for (int m = 0; m < count; m++) {
							new File(rootDir + "_" + i + "/" + "_" + j + "/" + "_" + k + "/" + "_" + l + "/" + "_" + m + "/").mkdirs();
							System.err
									.println(rootDir + "_" + i + "/" + "_" + j + "/" + "_" + k + "/" + "_" + l + "/" + "_" + m + "/");
						}
					}
				}
			}
		}
	}

	public void dirs10e10(String rootDir) {
		int count = 10;
		for (int i = 0; i < count; i++) {
			for (int j = 0; j < count; j++) {
				for (int k = 0; k < count; k++) {
					for (int l = 0; l < count; l++) {
						for (int m = 0; m < count; m++) {
							for (int n = 0; n < count; n++) {
								for (int o = 0; o < count; o++) {
									for (int p = 0; p < count; p++) {
										for (int q = 0; q < count; q++) {
											for (int r = 0; r < count; r++) {
												new File(rootDir + i + "/" + j + "/" + k + "/" + l + "/" + m + "/"
														+ n + "/" + o + "/" + p + "/" + q + "/" + r + "/").mkdirs();
												System.err
														.println(rootDir + i + "/" + j + "/" + k + "/" + l + "/" + m + "/"
																+ n + "/" + o + "/" + p + "/" + q + "/" + r + "/");
											}
										}
									}
								}
							}
						}
					}
				}
			}
		}
	}

	public void dirs(String root, long begin, long end) {
		int bit = new String(end + "").toCharArray().length;
		for (; begin <= end; begin++) {
			StringBuffer sb = new StringBuffer(root + "/");
			char[] cs = new String(begin + "").toCharArray();
			if (cs.length < bit) {
				for (int i = 0; i < bit - cs.length; i++) {
					sb.append("0/");
				}
			}
			for (int i = 0; i < cs.length; i++) {
				sb.append(cs[i] + "/");
			}
			System.err.println(sb.toString());
			new File(sb.toString()).mkdirs();
		}
	}

	public static void main(String args[]) {
		new MkDirs().dirs5e5("_System/");
//		new MkDirs().dirs("dirs", 0000L, 9999L);
	}
}
